//
//  PurchaseAddressCell.m
//  yigou
//
//  Created by wangdianlei on 2017/2/6.
//  Copyright © 2017年 hanyiwang. All rights reserved.
//

#import "PurchaseAddressCell.h"

@implementation PurchaseAddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    UIImageView *headerImage = [[UIImageView alloc]initWithFrame:CGRectMake(30*kScale, 30*kScale, 42*kScale, 42*kScale)];
    [headerImage setImage:[UIImage imageNamed:@"收件人图标"]];
    [self.contentView addSubview:headerImage];
    self.nameLable = [[UILabel alloc]initWithFrame:CGRectMake(92*kScale, 30*kScale,ScreenWidth, 42*kScale)];
    self.nameLable.text = @"姓名";
    [self.contentView addSubview:self.nameLable];
    
    CGFloat phoneTextW = 120;
    CGFloat phoneW = 26*kScale;
    CGFloat phoneH = 42*kScale;
    CGFloat errorH = 26;
    UIImageView *phoneImage = [[UIImageView alloc]initWithFrame:CGRectMake(ScreenWidth-30*kScale-phoneTextW-20*kScale-phoneW, 30*kScale, phoneW, phoneH)];
    phoneImage.image = [UIImage imageNamed:@"手机图标"];
    [self.contentView addSubview:phoneImage];
    self.phoneNumber = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-30*kScale-phoneTextW, 30*kScale, phoneTextW, 42*kScale)];
    self.phoneNumber.text = @"15345269633";
    [self.contentView addSubview:self.phoneNumber];
    UIImageView *addressImage = [[UIImageView alloc]initWithFrame:CGRectMake(30*kScale, 92*kScale, 42*kScale, 42*kScale)];
    addressImage.image = [UIImage imageNamed:@"地址图标"];
    [self.contentView addSubview:addressImage];
    self.introdocLable = [[UILabel alloc]init];
    self.introdocLable.font = [UIFont systemFontOfSize:15];
    self.introdocLable.numberOfLines = 1;
    //        introdocLable.lineBreakMode =  NSLineBreakByTruncatingTail;
    //    introdocLable.textColor = [UIColor colorWithRed:34/255.0 green:34/255.0 blue:34/255.0 alpha:1.0];
    //    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc]init];
    //    style.lineSpacing = 5;
    self.introdocLable.text = @"详细地址";
    //    CGSize introSize = [introdocLable sizeThatFits:CGSizeMake(kScreenW-122*kScale, MAXFLOAT)];
    
    //        NSDictionary *attributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSParagraphStyleAttributeName:style};
    //        introdocLable.attributedText = [[NSAttributedString alloc]initWithString:introdocLable.text attributes:attributes];
    
    
    self.introdocLable.frame = CGRectMake(30*kScale+42*kScale+20*kScale,92*kScale,ScreenWidth-122*kScale, 42*kScale);
    //    introdocLable.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.introdocLable];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
